#ifndef ENCODEROPTION_H
#define ENCODEROPTION_H

#include <QSize>
#include <QVariant>
#include <QObject>
#include <QHash>
#include <QSettings>

class EncoderOption: public QObject
{
    Q_OBJECT
public:
    EncoderOption (QSettings &, const QString &id = "");
    ~EncoderOption();

    EncoderOption & operator=(const EncoderOption &);


    virtual QVariant value (const QString &key, const QVariant &v = QVariant());
    virtual bool contains (const QString &key) const;

    virtual QHash<QString,QVariant> values() const { return m_values; }

    virtual void setId (const QString &id ) { m_id = id; }
    virtual QString id () const { return m_id; }

    virtual QString name () const;
    virtual void setName(const QString & name);


signals:
    void valueChanged(QString,QVariant);

public slots:
    void setValue (const QString &key,const QVariant &);

private:
    QHash<QString, QVariant> m_values;
    QString m_id;
    QSettings *m_settings;

private:
    void loadFromSettings ();
    void writeToSettings ();
};

#endif // ENCODEROPTION_H
